﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace BrainTechLLC
{
    [Serializable]
#if NO_SILVERLIGHT
    [Browsable(true)]
    [TypeConverter(typeof(ExpandableObjectConverter))]
#endif
    [DataContract]
    public class LocationInt : Vector4BaseInt, ILocationInt, INotifyPropertyChanged, INotifyPropertyChanging
    {
        public bool SameLocation(LocationInt other) { return X == other.X && Y == other.Y && Z == other.Z && W == other.W; }
        public bool SameLocationInt(LocationInt other) { return X == other.X && Y == other.Y && Z == other.Z && W == other.W; }
        public bool SameLocation(int xCheck, int yCheck, int zCheck) { return x == xCheck && y == yCheck && z == zCheck; }
        public override string ToString() { return SummaryText; }
        public LocationInt LocationVector { get { return this; } }
        public bool NoLocation { get { return (X == int.MinValue); } }
        public LocationInt(LocationInt location) : base(location) { }
        public LocationInt(Vector4BaseInt location) : base(location) { }
        public LocationInt(int x, int y, int z, int w) : base(x, y, z, w) { }
        public LocationInt(int x, int y, int z) : base(x, y, z) { }
        public LocationInt() : base() { X = int.MinValue; }
        public string SummaryText { get { return X.ToString() + "," + Y.ToString() + "," + Z.ToString(); } }
        public LocationInt Add(Vector4BaseInt vector) { return new LocationInt(X + vector.X, Y + vector.Y, Z + vector.Z, W + vector.W); }
    }
}
